<script type="text/javascript" src="/third-party/jquery.min.js"></script>

<table class="insert-tab" width="100%">
  <tbody>
  <tr>
    <th><i class="require-red">*</i>柜员名称：</th>
    <td><input class="common-text required" name="name" id="name" size="50" type="text"></td>
  </tr>
  <tr>
    <th><i class="require-red">*</i>登陆口令：</th>
    <td><input class="common-text required" name="password" id="password" size="20" type="password"></td>
  </tr>
  <tr>
    <th><i class="require-red">*</i>再次输入登陆口令：</th>
    <td><input class="common-text required" name="repassword" id="repassword" size="20" type="password"></td>
  </tr>
  <tr>
    <th><i class="require-red">*</i>可办理业务类型：</th>
    <td>
      <%for(business in businessList) {%>
      <input type="checkbox" name="businessId" value="${business.id }">&nbsp;&nbsp;${business.name }<br/>
      <%}%>
    </td>
  </tr>
  <tr>
    <th></th>
    <td>
      <input type="button" class="btn btn-primary btn6 mr10" value="提交" onclick="submitForm();">
      <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
    </td>
  </tr>
  </tbody>
</table>

<script type="text/javascript">
function submitForm() {
  if($("#name").val() == '') {
    alert("柜员名称不可为空");
    return;
  }
  if($("#password").val() == '') {
    alert("柜员登录口令不可为空");
    return;
  }
  if($("#password").val() != $("#repassword").val()) {
    alert("两次输入口令不一致");
    $("#password").val('');
    $("#repassword").val('');
    return;
  }
  document.forms[0].submit();
}
</script>